/*!
 * \file TestGenerator.h
 * \brief Definitions for unit tests of generator framework
 */

#ifndef _TEST_GENERATOR_H
#define _TEST_GENERATOR_H

#include "StateBase.h"
#include "EventData.h"
#include "Generator.h"
#include "GeneratorEnvironment.h"

namespace tsc_test
{

class TestState1 : public tsc::common::StateBase
{
public:
	TestState1() : StateBase("State1") {}

	void handleEvent(tsc::common::Generator* generator, tsc::common::EventData*& event);
};

class TestState2 : public tsc::common::StateBase
{
public:
	TestState2() : StateBase("State2") {}

	void handleEvent(tsc::common::Generator* generator, tsc::common::EventData*& event);
};

class TestStateMap
{
public:
	TestStateMap():
		_state1(new TestState1),
		_state2(new TestState2)
	{

	}

	static TestStateMap& instance()
	{
		static TestStateMap map;
		return map;
	}

	tsc::common::StateBase* initialState()
	{
		return _state1;
	}

	TestState1* _state1;
	TestState2* _state2;
};

class TestGenerator : public tsc::common::Generator
{
public:
	TestGenerator(tsc::common::GeneratorEnvironment& ge);
};

class TestEvent :  public tsc::common::EventData
{
public:
	TestEvent(tsc::common::SIGNO signo) :
		tsc::common::EventData(tsc::common::SIGNAL_BASE + signo) {}
};


} // namespace tsc_test

#endif // _TEST_GENERATOR_H
